package com.sikaryofficial.backend.service;

/**
 * @author : qinjinyuan
 * @desc : 积分策略接口
 * @date : 2023/10/31 18:53
 */
public interface IPointsDetailStrategy {

    String SUFFIX = "_point_service";

    /**
     * 校验积分是否已满
     *
     * @param userId
     * @param code
     * @param redisCacheKey
     * @return
     */
    boolean checkPointsOver(Long userId, String code, String redisCacheKey);

    boolean checkPointsOverNoDate(Long sourceId, String code, String redisCacheKey);

    /**
     * 增加积分前校验
     *
     * @param userId
     * @return
     */
    boolean beforeIncrease(Long userId);

    /**
     * 更新积分明细数据
     *
     * @param sourceId
     * @param userId
     * @return
     */
    boolean updatePoints(Long sourceId, Long userId);

    /**
     * 更新积分明细数据
     *
     * @param sourceId
     * @param userId
     * @param sourceName
     * @return
     */
    boolean updatePoints(Long sourceId, Long userId, String sourceName);

    /**
     * 根据输入值更新积分明细数据
     *
     * @param sourceId
     * @param userId
     * @return
     */
    boolean updatePointsByInputValue(Long sourceId, Long userId, Integer pointsDetailValue, String param, String sourceName);

    /**
     * 增加积分后续处理
     *
     * @param userId
     * @return
     */
    boolean afterIncrease(Long userId);

    /**
     * 增加积分后续处理
     *
     * @param objectId
     * @return
     */
    boolean after(Long objectId);
}
